FROM apache/airflow:slim-latest-python3.10
LABEL maintainer="Shan You <shanyou@htyunwang.com>"
#使用aliyun的源
USER root
RUN cp /etc/apt/sources.list.d/debian.sources /etc/apt/sources.list.d/debian.sources.bak
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources \
&& sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources

# 修改时区
RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata libpq-dev build-essential && rm -f /etc/localtime \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata
USER airflow
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
COPY requirements.txt /requirements.txt
RUN pip install -r /requirements.txt